# Author: Yu Bin
# Date: 2024/12/28 10:57:44
# E-mail: 853823259@qq.com

# 面向对象基础
class Person:
    def __init__(self, name, age, height):
        self.name = name
        self.age = age
        self.height = height

    def run(self):
        print(self.name+'正在奔跑')

    def eat(self):
        print(self.name+'正在吃东西')


# 实例化
elephant = Person('大象', 18, 1.75)
print(elephant.name,elephant.age,elephant.height)
elephant.run()
tiger=Person('老虎',17,1.65)
print(tiger.name,tiger.age,tiger.height)
tiger.run()

class Dog:
    def __init__(self,name,color):
        self.name=name
        self.color=color
    def shout(self):
        print(self.name+"汪汪叫")
    def swing(self):
        print(self.name+"摇尾巴")

dahuang=Dog("大黄","yellow")
dahuang.shout()

print(dir(Person))